#ifndef FUNC_KEYMODE_H_
#define FUNC_KEYMODE_H_

#include "sh30f9871.h"
#include "tm1629a.h"


typedef enum
{
	AUTOMODE = 1,
	COLDMODE,
	DEHUMIDIFYMODE,
	FANMODE,
	HOTMODE,
	EMPTYMODE,
}MODE;

typedef enum
{
	MODE_OFF,
	MODE_ON
}ModeState;

typedef enum
{
	AUTO_COOL = 1,
	AUTO_HOT,
	AUTO_DRY
}AutoModeState;


typedef struct{
	float   LastTemperature;
	float   Temperature;
	uint8_t WindSpeed;
	uint8_t UpDownSwing;
	uint8_t LeftRightSwing;
//	uint8_t EcoState;
	uint8_t EcoSwitch;
}COLDMODEINFO;

typedef struct{
	float   LastTemperature;
	float   Temperature;
	uint8_t Humidity;
	uint8_t WindSpeed;
	uint8_t UpDownSwing;
	uint8_t LeftRightSwing;
}DEHUMIDITYMODEINFO;


typedef struct{
	float   Temperature;	
	uint8_t WindSpeed;
	uint8_t UpDownSwing;
	uint8_t LeftRightSwing;	
}FANMODEINFO;


typedef struct{
	float   LastTemperature;
	float   Temperature;
	uint8_t WindSpeed;
	uint8_t UpDownSwing;
	uint8_t LeftRightSwing;
//	uint8_t EcoState;
	uint8_t EcoSwitch;	
}HOTMODEINFO;

typedef struct{
	float   Temperature;
	uint8_t WindSpeed;
	uint8_t UpDownSwing;
	uint8_t LeftRightSwing;	
}EMPTYMODEINFO;


extern COLDMODEINFO g_tColdModeInfo;
extern DEHUMIDITYMODEINFO g_tDehumidityModeInfo;
extern FANMODEINFO g_tFanModeInfo;
extern HOTMODEINFO g_tHotModeInfo;
extern EMPTYMODEINFO g_tEmptyModeInfo;


void AirConditionModeDisplay(uint8_t mode,UISYNC SyncFlag);
void CalculateModeIndex(uint8_t mode);
float GetTemperatureNum(void);
void SetAirMode(uint8_t state);
uint8_t GetAirMode(void);
uint8_t AirGetModeState(void);
void TemperatureNumSet(float Temp);
void ModeSwitching(void);
void ColdModeAction(float temp);
void DehumidifyModeAction(uint8_t Humidify,float temp);
void FanModeAction(void);
void HotModeAction(float temp);
void EmptyModeAction(void);
void ModeKeyHandler(void);
void ModeSelectionDisplay(uint8_t mode);
void ModeSelection(uint8_t mode,UISYNC SyncFlag);
#endif




